package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.InfoBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class UpdateUserInfoMethods extends BaseMethods {

    private static UpdateUserInfoMethods m_ins = null;

    public static UpdateUserInfoMethods getInstance() {
        if (m_ins == null) {
            synchronized (UpdateUserInfoMethods.class) {
                if (m_ins == null) {
                    m_ins = new UpdateUserInfoMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void upuserdata(Subscriber<Object> subscriber,
                      int uid ,
                      String hashid ,String face,String nikename,String sex ,String city ,String birth,String invitationcode  ) {
        Observable observable = initService().updateUser(System.currentTimeMillis()+"",
                "2eb18fe4d01c6cb8b3d602f00e460144",uid,hashid ,face,nikename,sex,city,birth,invitationcode
        );
        toSubscribe(observable, subscriber);
    }
}
